import request from "@/api/utils/request.js";

const BASE_PREFIX = "/user";

export default {

  getUserInfo(userId) {
    return request({
      url: `${BASE_PREFIX}/getUserInfo`,
      method: 'post',
      data: {
        userId: userId
      }
    })
  },

  updateEmailOrMobileVerifyCodeCheck(work_type, target, verify_code) {
    return request({
      url: `${BASE_PREFIX}/updateEmailOrMobileVerifyCodeCheck`,
      method: 'POST',
      data: {
        workType: work_type,
        target: target,
        verifyCode: verify_code
      }
    })
  },

  updateEmail(user_id, email, check_key) {
    return request({
      url: `${BASE_PREFIX}/updateEmail`,
      method: 'PUT',
      data: {
        userId: user_id,
        email: email,
        checkKey: check_key
      }
    })
  },

  updateAvatarAndNickName(user_id, nick_name, avatar) {
    return request({
      url: `${BASE_PREFIX}/updateAvatarAndNickName`,
      method: 'PUT',
      data: {
        userId: user_id,
        nickName: nick_name,
        avatar: avatar
      }
    })
  }

}
